//
//  SPUserInfoController.m
//  Sport
//
//  Created by Cass on 2018/3/28.
//  Copyright © 2018年 Cass. All rights reserved.
//

#import "SPUserInfoController.h"

@interface SPUserInfoController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UIImageView *headImg;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UIImageView *bgImg;

@end

@implementation SPUserInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.headImg.layer.cornerRadius = self.headImg.bounds.size.width / 2;
    self.headImg.layer.masksToBounds = YES;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    if (section == 0) {
        return 3;
    }else{
        return 3;
    }
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *ID = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    if (indexPath.section == 0) {
        if (indexPath.row == 0) {
            cell.textLabel.text = @"昵称:     GTMD下雨天";
        }else if (indexPath.row == 1){
            cell.textLabel.text = @"性别:     男";
        }else if (indexPath.row == 2){
            cell.textLabel.text = @"年龄:     23";
        }
    }else if(indexPath.section == 1){
        if (indexPath.row == 0) {
            cell.textLabel.text = @"爱好:     篮球";
        }else if (indexPath.row == 1){
            cell.textLabel.text = @"所在地:     成都";
        }else{
            cell.textLabel.text = @"职业:     城管";
        }
    }
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 15.0f;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 5.0f;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}

@end
